<%@ tag language="java" pageEncoding="ISO-8859-1"%>

<%@ attribute name="title_webpage" required="true" type="java.lang.String" %>
<%@ attribute name="arg" type="java.lang.String" %>
<%@ attribute name="tab_index" required="false" type="java.lang.Integer" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>

<c:set var="ot_version" value="1.0" scope="application" />
<c:set var="url_context" value="${pageContext.request.contextPath}" scope="application" />

<c:set var="url_style" value="${url_context}/styles" scope="application" />
<c:set var="url_script" value="${url_context}/script/ideyatech-${ot_version}" scope="application" />
<c:set var="url_script_iris" value="${url_context}/script" scope="application" />
<c:set var="url_script_lib" value="${url_script_iris}/js-libraries" scope="application" />
<jsp:useBean id="currentUser" class="org.opentides.util.SecurityUtil" />

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		
		<title>
			<spring:message code="${title_webpage}" arguments="${arg}"/>
		</title>
		
		<script type="text/javascript">
			var url_context = '${url_context}';
		</script>
		
		
		<!-- STYLES -->
		<link rel="stylesheet" type="text/css" href="${url_style}/bs-iris-all.css" />
		
		<!-- JQUERY -->
		<script type="text/javascript" src="${url_script_lib}/jquery-1.7.2.js"></script>
	
		<!-- JQUERY UI -->
	    <link rel="stylesheet" type="text/css" href="${url_script_lib}/jquery-ui/theme/jquery.ui.all.css" />
	    <script type="text/javascript" src="${url_script_lib}/jquery-ui/jquery-ui-1.8.22.custom.js"></script>

		<!-- IDEYATECH SCRIPTS -->
	    <script src="${url_script}/crud.js"></script>
	    <script type="text/javascript" src="${url_script_iris}/iris-all.js"></script>
	    
	    <!-- BOOTSTRAP -->
    	<link href="${url_context}/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    	<script src="${url_context}/bootstrap/js/bootstrap.min.js"></script>
    	
    	<!-- TINYBOX 2 -->
	    <link rel="stylesheet" type="text/css" href="${url_script_lib}/tinybox2/tinybox.css" />
	    <script src="${url_script_lib}/tinybox2/tinybox.js"></script>
	  
	  	<jsp:doBody />
	</head>
	
	<body>
		<div class="container">
			<!-- HEADER -->
			<div class="navbar navbar-fixed-top">
				<div class="navbar-inner">
					<div class="container">
						<a class="brand">IRIS</a>
						<ul class="nav">
							<li class="divider-vertical"></li>
							<security:authorize ifAnyGranted="ACCESS_DASHBOARD_TAB">
								<li><a href="${url_context}/dashboard.jspx">Dashboard</a></li>
							</security:authorize>
							<security:authorize ifAnyGranted="ACCESS_PATIENTS_TAB">
								<li><a href="${url_context}/patients.jspx">Patients</a></li>
							</security:authorize>
<%-- 							<security:authorize ifAnyGranted="ACCESS_REPORTS_TAB"> --%>
<%-- 								<li><a href="${url_context}/reports-view.jspx">Reports</a></li> --%>
<%-- 							</security:authorize> --%>
							
							<security:authorize ifAnyGranted="ACCESS_ADMINS_TAB">
								<li class="dropdown">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown">
										Admin <b class="caret"></b>
									</a>
									<ul class="dropdown-menu">
	<%-- 									<security:authorize ifAnyGranted="ACCESS_PROGRAMS_TAB"> --%>
	<%-- 										<li><a href="${url_context}/medicalPrograms.jspx">Programs</a></li> --%>
	<%-- 									</security:authorize> --%>
										<security:authorize ifAnyGranted="ACCESS_PROCEDURES_TAB">
											<li><a href="${url_context}/medicalProcedures.jspx">Procedures</a></li>
										</security:authorize>
										<security:authorize ifAnyGranted="ACCESS_MEDICINES_TAB">
											<li><a href="${url_context}/medicines.jspx">Medicines</a></li>
										</security:authorize>
										<security:authorize ifAnyGranted="ACCESS_ALLERGENS_TAB">
											<li><a href="${url_context}/allergens.jspx">Allergens</a></li>
										</security:authorize>
										<security:authorize ifAnyGranted="ACCESS_DISEASES_TAB">
											<li><a href="${url_context}/diseases.jspx">Diseases</a></li>
										</security:authorize>
										<li><a href="${url_context}/staffs.jspx">Staffs</a></li>
										<li><a href="#">Users</a></li>
									</ul>
								</li>
							</security:authorize>
							
							<li><a href="${url_context}/register.jspx">Register</a></li>
						</ul>
						<ul class="nav pull-right">
							<li>
								<form class="navbar-search">
									<input type="text" class="search-query" placeholder="Search">
								</form>	
							</li>
							<li class="divider-vertical"></li>
							<li class="dropdown">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">
									${currentUser.user.firstName} ${currentUser.user.lastName} <b class="caret"></b>
								</a>
								<ul class="dropdown-menu">
									<li><a href="${url_context}/j_spring_security_logout">Sign Out</a></li>
								</ul>
							</li>
						</ul>
					</div>
				</div>
			</div>